package com.abbas.CayTcore.base

import com.abbas.CayTcore.CoreApp
import com.abbas.CayTcore.entity.TCoreBase
import com.abbas.CayTcore.retrofit.RetrofitManager
import com.abbas.CayTcore.subscribeDbResult

abstract class BaseModel {

    val db = CoreApp.db
    val api = RetrofitManager.getApi()


    fun getCore(id: Int, block: (core: TCoreBase) -> Unit) {
        db.coreDao()
            .getCoreOfId(id)
            .subscribeDbResult({
                block.invoke(it)
            }, {
                val a = 1
            })
    }




}

